home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / ftplugin / vb.vim < prev    next >
Encoding:
Text File  |  2001-09-22  |  1.7 KB  |  46 lines

  1. " Vim filetype plugin file
  2. " Language:    VisualBasic (ft=vb)
  3. " Maintainer:    Johannes Zellner <johannes@zellner.org>
  4. " Last Change:    Tue, 18 Sep 2001 23:00:50 +0200
  5.  
  6. if exists("b:did_ftplugin") | finish | endif
  7. let b:did_ftplugin = 1
  8.  
  9. setlocal nocindent
  10. setlocal autoindent
  11. setlocal foldmethod=syntax
  12. setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
  13.  
  14. " we need this wrapper, as call doesn't allow a count
  15. fun! <SID>VbSearch(pattern, flags)
  16.     let cnt = v:count1
  17.     while cnt > 0
  18.     call search(a:pattern, a:flags)
  19.     let cnt = cnt - 1
  20.     endwhile
  21. endfun
  22.  
  23. let s:cpo_save = &cpo
  24. set cpo&vim
  25.  
  26. " NOTE the double escaping \\|
  27. nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(private\s\+\)\=\(function\\|sub\)', 'bW')<cr>
  28. nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(private\s\+\)\=\(function\\|sub\)', 'W')<cr>
  29. nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
  30. nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
  31.  
  32. " matchit support
  33. if exists("loaded_matchit")
  34.     let b:match_ignorecase=1
  35.     let b:match_words=
  36.     \ '\%(^\s*\)\@<=\<if\>:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
  37.     \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
  38.     \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
  39.     \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
  40.     \ '\%(^\s*\)\@<=\%(\<private\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
  41.     \ '\%(^\s*\)\@<=\%(\<private\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
  42. endif
  43.  
  44. let &cpo = s:cpo_save
  45. unlet s:cpo_save
  46.